package com.yugao.fintech.libra.common.util.number;

import org.springframework.util.Assert;

public class NumberUtils {

    /**
     * equal to
     */
    public static boolean eq(Integer left, Integer right) {
        Assert.notNull(left, "left must not be null");
        Assert.notNull(right, "right must not be null");
        return  left.equals(right);
    }

    /**
     * not equal to
     */
    public static boolean ne(Integer left, Integer right) {
        Assert.notNull(left, "left must not be null");
        Assert.notNull(right, "right must not be null");
        return  ! left.equals(right);
    }

    /**
     * less than
     */
    public static boolean lt(Integer left, Integer right) {
        Assert.notNull(left, "left must not be null");
        Assert.notNull(right, "right must not be null");
        return  left < right;
    }

    /**
     * less than or equal to
     */
    public static boolean lte(Integer left, Integer right) {
        Assert.notNull(left, "left must not be null");
        Assert.notNull(right, "right must not be null");
        return  left <= right;
    }

    /**
     * greater than
     */
    public static boolean gt(Integer left, Integer right) {
        Assert.notNull(left, "left must not be null");
        Assert.notNull(right, "right must not be null");
        return  left > right;
    }

    /**
     * greater than or equal to
     */
    public static boolean gte(Integer left, Integer right) {
        Assert.notNull(left, "left must not be null");
        Assert.notNull(right, "right must not be null");
        return  left >= right;
    }
}
